package com.dc.service.impl;

import com.dc.base.pojo.BaseModel;
import com.dc.mapper.SysUserDao;
import com.dc.pojo.SysUser;
import com.dc.service.SysUserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysUserServiceImpl implements SysUserService {
    @Autowired private SysUserDao userDao;
    public BaseModel selectUserAll(Integer page,Integer maxSize) {
        BaseModel baseModel=new BaseModel();
        PageHelper.startPage(page,maxSize);
        List<SysUser> users=userDao.selectUserAll();
        PageInfo userList=new PageInfo(users,5);
        baseModel.setResultCode(0);//如果为0则表示成功
        baseModel.setMessage("查询用户列表成功！");
        baseModel.setData(userList);
        return baseModel;
    }
}
